@extends('layouts.admin')

@section('title', '|imgur')

@section('content')

    <table class="table table-hover">
        <thead>
        <tr>
            <th>#</th>
            <th>标题</th>
            <th>标题翻译</th>
            <th>图片数量</th>
            <th>时间</th>
            <th><span class="glyphicon glyphicon-edit"></span></th>
        </tr>
        </thead>
        <tbody>

        @foreach($imgurs as $gur)
            <tr>
                <td>{{$gur->id}}</td>
                <td>
                    {{$gur->title}}
                </td>
                <td>
                    {{$gur->title_translation}}
                </td>
                <td>
                    {{$gur->images->count()}}
                </td>
                <td>{{$gur->created_at->diffForHumans()}}</td>
                <td>
                    <a href="edit/{{$gur->id}}" class="btn btn-info" target="_blank">编辑</a>
                    @if($gur->deleted_at)
                        <a class="btn btn-warning" target="_blank">已删除</a>
                    @else
                        <a href="delete/{{$gur->id}}" class="btn btn-danger" target="_blank">删除</a>
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>

    <div>
        {!! $imgurs->links() !!}
    </div>
@endsection

@section('scripts')

@endsection
